<html xmlns:th="http://www.thymeleaf.org" >
<head th:include="admin/common/resource ::commonHead('首页')" ></head>
<link th:href="@{/layui/css/layui.css}" rel="stylesheet"/>
<link th:href="@{/layui/css/eleTree.css}" rel="stylesheet"/>
<style>
    li{
        list-style: none;
    }
    #list{
        margin-top: 20px;
        margin-bottom: 12px;
    }
</style>
<body style="padding: 0px;margin: 0px">
    <div class="container-fluid">

        <div  id="view" ></div>
        <!-- 分页 -->

    </div>
</body>
<div th:include="admin/common/resource ::footerJs"></div>
<script th:src="@{/layui/layui.all.js}"></script>
<script th:inline="javascript" >

    var list = [[${perms}]];
    var view;
    layui.config({
            base: "/layui/lay/modules/"
        }).use(['jquery','eleTree'],function () {
        var $ = layui.jquery,
            tree = layui.eleTree;

        view = tree.render({
            elem:'#view',
            showCheckbox:true,
            showLine:true,
            data:list,
            request: {
                name: "actionName",
                key: "id",
                children: "children",
                checked: "perms",
                disabled: "disabled",
                isLeaf: "isLeaf"
            }
        })
    })

    function submit() {
        var list = view.getChecked(false,true);
        var data = [];
        $.each(list,function (k,v) {
            data.push(v.id)
        })
        return data;
    }

</script>
</html>